Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- JAVA INTERVIEW



  ConcurrentHashMap vs Collections.synchronizedMap()

ConcurrentHashMap and Collections.synchronizedMap() both provide thread-safe operations of collections of data. They are used in multithreaded programs to provide both thread safety and performance improvements. In many cases, we can use either of them. But the realization of thread safety is different for these two implementations. ConcurrentHashMap will create an HashEntry[] array internally to store the elements passed in from a Map, while Collections.synchronizedMap() will return a Synchroni...

   ConcurrentHashMap,Collections.synchronizedMap     2014-09-18 05:04:59

  Why 102 years for Alibaba

In many occasions, Alibaba Group Founder Jack Ma expresses the idea that he wanted Alibaba to be live for 102 years(a strange number). But why 102 years, but not 100 years or some other years?  In an interview conducted by Stanford University, the interviewer, Yahoo Founder Jerry Yang, asked this question why Jack Ma wanted Alibaba to live 102 years. Jack Ma gave his answer to this question. "In China, everybody wanted to make a company last over 100 years. This becomes a slogan, nobody ta...

   JACK MA,ALIBABA,STANFORD UNIVERSITY,JERRY YANG     2016-02-24 09:46:47

  NIO vs IO in Java

Java 1.4 provides a new API for handling IO -- NIO. This is a non-blocking and buffer oriented IO API. Below are main differences between the NIO and IO in Java. IO NIO Stream oriented Buffer oriented Blocking IO Non-blocking IO N/A Using selector Stream oriented vs Buffer oriented The main difference is that IO is stream oriented where the data is read byte by byte and the data will not be buffered normally.This means there is no pointer to move forward and backward in the stream. I...

   JAVA,IO,NIO     2016-01-10 01:40:02

  Work is not challenging is just an excuse in interview?

Usually when an interviewer asks the interviewee why he/she wants to change his/her job, one answer may be "My current job is not challenging, I want a more challenging job.". The interviewer may tend to think that there are always challenges everywhere and why the interviewee indulges himself/herself without putting much effort on his/her work.   Here I want to say something to our interviewers. Work challenging is not equal to personal indulgence. The work is challenging which is an...

   Job,Interview,Challenge,Excuse     2012-04-18 07:03:12

  Different types of keystore in Java -- JKS

JKS is Java Keystore, a proprietary keystore type designed for Java. It can be used to store private keys and certificates used for SSL communication, it cannot store secret keys however. The keytool shipped with JDKs cannot extract private keys stored on JKS. This type of keystore usually has an extension of jks. Next we will show how to operate the JKS keystore with pure Java code. Create JKS keystore The simplest method to create a JKS keystore to create an empty keystore. We can first get an...

   DEMO,EXAMPLE,KEYSTORE,JKS     2014-09-05 20:21:51

  When will resizing be triggered in Java HashMap?

HashMap is one of the most frequently used collection types in Java, it stores key-value pairs. Ideally it expects to use hash table which expects the data access time complexity to be O(1), however, due to hash conflicts, in reality, it uses linked list or red-black tree to store data which makes the worst case time complexity to be O(logn).  Although collections are using data structures like arrays and linked lists, unlike arrays, they will dynamically resize when there is not enough spa...

   JAVA,RESIZE,HASHMAP,THRESHOLD     2020-05-02 20:41:19

  Vine video sharing drops significantly

According to Sina Tech, social media analytics site Topsy data shows that Vine's short video sharing has dropped significantly since Facebook's photo sharing service Instagram launched the video sharing feature.Instagram co-founder Kevin Systrom announced on Thursday that Instagram supported short video sharing. Vine was once called the Instagram in video sharing world, but now, Instagram has launched its own 15-second short video sharing feature for its 130 million users.Vine, was acquired by T...

   Vine,Instagram,Twitter,topsy     2013-06-24 00:16:32

  Are older people better programmers?

Peter Knego states something interesting: “It's official: developers get better with age. And scarcer.”. He uses reputation and other metrics from StackOverflow to corroborate his point. His summary is: Number of coders drops significantly with age. Top developer numbers, at age 27, drop by half every 6-7 years.Developers in their 40s answer roughly twice as much and ask half the questions compared to colleagues in their 20s. It seems younger generation learns and older generatio...

   Programming,Age,Experience,Skill,Advanta     2011-07-28 09:02:23

  Understand more about Go basics with one interview question

First, let's take a look at below Go interview question: package main const s = "Go101.org" // len(s) == 9 // 1 << 9 == 512 // 512 / 128 == 4 var a byte = 1 << len(s) / 128 var b byte = 1 << len(s[:]) / 128 func main() { println(a, b) } What would be the output in your mind? The output would be 4 0. Surprising? Before getting to the output values, some concepts in Go need to be introduced and explained in more detail. len()  len() is a built-in function in Go to get t...

   GOLANG,CONSTANT,SHIFT OPERATION,LEN()     2020-10-10 02:52:19

  Only fast languages are interesting

If this isn’t a Zawinski quote, it should be. I have avoided the JVM my entire life. I am presently confronted with problems which fit in the JVM; JVM libraries, concurrency, giant data: all that good stuff. Rather than doing something insane like learning Java, I figured I’d learn me some Clojure. Why not? It’s got everything I need: JVM guts, lispy goodness; what is not to love? Well, as it turns out, one enormous, gaping lacuna is Clojure’s numerics performanc...

   Fast language,Clojure,Perl,JVM SLOW,Lush     2011-11-30 11:16:01